import { createApp } from 'vue'
import App from './App.vue'
import { registerSW } from 'virtual:pwa-register'
import './style.css'

const app = createApp(App)
app.mount('#app')

// 注册 Service Worker 并提示安装
const updateSW = registerSW({
  onNeedRefresh() {
    if (confirm('有新版本可用，是否更新？')) {
      updateSW()
    }
  }
})